#ifndef CHARACTER_H
#define CHARACTER_H

#include "Moving Entity.h"
#include <list>
#include <vector>


class Collision;
class PathPlanner;
class Path;
class Goal_Obey;



struct Stats
{
	// Attack
	double cutting;
	double piercing;

	// and so on
};



class Character : public MovingEntity
{
friend class Goal_TakePathToRange;

private:
	Stats m_Stats;
	

	// A list of all unhandled collisions the character is experiencing
	list<Collision*> m_Collisions; 

	// The state machine that defines the characters current state
	StateMachine<Character>* m_pStateMachine;

	// The Group to which this character currently belongs. 
	// Is negative when it does not belong to any
	int m_iGroupID;

	// A list of the characters in the characters group. 
	list<Character*> m_lGroupMembers;

	// The main goal
	Goal_Obey* m_pObey;

public:
	void AddCollision(Collision* newCollision);

	// Constructors
	Character(string name, Vector2D pos, int type);
	~Character();

	// Group Related
	int GroupID();
	void UpdateGroupMembers();

	void AddToGroup(int groupID);
	void RemoveFromGroup();

	void FollowCharacter(Character* aChar, Vector2D offset);
	void StopFollowingCharacter();

	
	// Collisions
	void HandleCollisions(); 

	void EvadeCharacter(Character* aChar);
	void StopEvadingCharacter();

	// Stuff
	void Update(double time_elapsed);
	bool HandleMessage(const Message &msg);
	void Render();

	// Can't think of a title.
	void SetArriveDestination(Vector2D dest);
	void StopArriving();

	void TakePathToLocation(Path* aPath);
	void ForgetTheFreakinPath();

	void RecalculatePath();
	Path* GetPath();

	void TurnSeparationOn(list<Character*> neighbors);
	void TurnSeparationOff();


};
#endif
